package com.jzo2o.customer.controller.agency;


import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zcx
 * @since 2024-12-12
 */
@RestController
@RequestMapping("/agency/bank-account")
@Api(tags = "客户PC端 - 银行账号相关接口")
public class BankAccountMsgController {
  @Resource
    private IBankAccountMsgService iBankAccountMsgService;
  @PostMapping()
  @ApiOperation("新增或者更新银行账号信息")
    public BankAccountResDTO addOrUpdateBankMsg(@RequestBody BankAccountUpsertReqDTO dto){
      return iBankAccountMsgService.addOrUpdateBankMsg(dto);
  }

  @GetMapping("/currentUserBankAccount")
  @ApiOperation("获取当前用户银行账号信息")
  public BankAccountResDTO getBankMsgById(){
    return iBankAccountMsgService.getBankMsgById();
  }
}
